package com.bwie.activity.controller;

import com.bwie.activity.service.DictService;
import com.bwie.common.pojo.res.DictRes;
import com.bwie.common.result.Result;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequiredArgsConstructor
public class DictController {
    private final DictService dictService;

    /**
     * 根据字典类型查询
     * @param dictType
     * @return
     */
    @GetMapping("/getDictByType/{dictType}")
    public Result<List<DictRes>> getDictByType(@PathVariable String dictType){
        List<DictRes> dictRes = dictService.getDictByType(dictType);
        return Result.success(dictRes);
    }
}
